﻿@model IEnumerable<PaginaWeb.Models.MiProducto>
@{
   Layout = null;
}

<table class="table" ALIGN="center">
   <tr>
       <th>
           @Html.DisplayNameFor(model => model.nombre)
       </th>
       <th>
           @Html.DisplayNameFor(model => model.modelo)
       </th>
       <th>
           @Html.DisplayNameFor(model => model.precio)
       </th>
       <th>
           @Html.DisplayNameFor(model => model.descripcion)
       </th>
       <th>
            Foto
       </th>
        <th>
           @Html.DisplayNameFor(model => model.marca)
       </th>
   </tr>

@foreach (var item in Model) {
   <tr>
       <td>
               <a href="~/Producto/Details/@item.id" target="_new">
               @Html.DisplayFor(modelItem => item.nombre)
                     </a>
       </td>
      
       <td>
           @Html.DisplayFor(modelItem => item.modelo)
       </td>
       <td>
           @Html.DisplayFor(modelItem => item.precio)
       </td>
       <td>
           @Html.DisplayFor(modelItem => item.descripcion)
       </td>
       <td>
           @if (item.url != null) {
               <img src="@Html.DisplayFor(modelItem => item.url)" height="150" width="150"/>
           } else {
               <img src="@Url.Content("~/Content/imagenes2/" + item.id + ".jpg")" height="150" width="150"/>
           }
       </td>
         <td>
               <a href="~/Marca/Details/@item.marca.id" target="_new">
               @Html.DisplayFor(modelItem => item.marca.nombre)
                     </a>
       </td>
   </tr>
}

</table>



@*@model IEnumerable<PaginaWeb.Models.MiProducto>

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_ClienteLayout.cshtml";
}

<h2>Busqueda</h2>

<table class="table table-hover">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.nombre)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.descripcion)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.modelo)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.precio)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.marca)
        </th>
        <th>
            Foto
        </th>
    </tr>
    <tbody data-bind="foreach: misproductos">
       <tr>
           <th>
               <span  data-bind="text: nombre"></span> 
           </th>
           <th>
               <span  data-bind="text: descripcion"></span> 
           </th>
            <th>
               <span  data-bind="text: modelo"></span>
           </th>
           <th>
               <span  data-bind="text: precio"></span> 
           </th>
           <th>
               <span data-bind="text: marca.nombre"></span>
           </th>
          <th>
              <span data-bind="text: marca.nombre"></span>
               <img data-bind="attr:{src: '@Url.Content("~/Content/Imagenes2/")' + id + '.jpg'}"  height="150" width="150" /> 
           </th>
       </tr>
   </tbody>
</table>
*@
